package com.cp.exception;

import com.cp.common.HttpStatusCode;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * 业务异常
 *
 * @author XL
 * @Date 2021/9/8 9:16
 */
@EqualsAndHashCode(callSuper = true)
@Data
public class BusinessException extends RuntimeException {
    private static final long serialVersionUID = 5583674001415992484L;

    private int code = HttpStatusCode.ERROR;

    public BusinessException() {
        super("业务异常");
    }

    public BusinessException(int code) {
        super("业务异常");
        this.code = code;
    }

    public BusinessException(String message) {
        super(message);
    }

    public BusinessException(int code, String message) {
        super(message);
        this.code = code;
    }

}
